<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'vertrigo';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
  die('Could not connect: ' . mysql_error());
}

$sql = "insert into staffs(id,name) values('','$_POST[name]')";

mysql_select_db('tdc');
$retval = mysql_query( $sql, $conn );
if(!$retval )
{
  die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
echo "<a href='index.php'>Back to main page</a>";
mysql_close($conn);
?>